<template>
  <Portlet title="申诉信息">
    <el-form label-position="left" label-width="120px">
      <el-row :gutter="15">
        <el-col :span="24">
          <el-form-item label="申诉账号：">
            <span>{{ appealUserName }}</span>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="申诉时间：">
            <span>{{appealDate | unixTimestampFilter}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="申诉说明：">
            <span>{{appealMemo}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label="申诉图片：">
            <upload-image :formData="{}" :value="getImage(appealPic)" :readonly="true"></upload-image>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </Portlet>
</template>
<script>
import {dotData} from '@/utils'
import {unixTimestampFilter} from '@/filters'

export default {
  name: 'refundAppeal',
  components: {},
  filters: {
    unixTimestampFilter
  },
  props: {
    refundDetail: {
      type: Object,
      required: true
    }
  },
  computed: {
    appealUserName() {
      return dotData(this.refundDetail, 'appealUserName')
    },
    appealDate() {
      return dotData(this.refundDetail, 'appealDate')
    },
    appealMemo() {
      return dotData(this.refundDetail, 'appealMemo')
    },
    appealPic() {
      return dotData(this.refundDetail, 'appealPic')
    }
  },
  methods: {
    // 获取图片
    getImage(val) {
      if (Array.isArray(val)) {
        return val
      }
      if (typeof val === 'string' && val) {
        return val.split(',')
      }
      return []
    }
  }
}
</script>
